public class Main {
    public static void main(String[] args) throws Exception {
     DummyHeadLinkedList<Integer> linkedList = new DummyHeadLinkedList<>();
        for (int i = 0; i < 5; i++) {
            linkedList.addFirst(i);
            System.out.println(linkedList.toString());
        }

        Integer remove = linkedList.remove(2);
        System.out.println(remove);
        System.out.println(linkedList);
    }
}